<template>
  <a-modal
    title="详情"
    :maskClosable="false"
    :width="1050"
    placement="right"
    :closable="true"
    :footer="null"
    @cancel="onClose"
    :visible="feeInfoVisiable"
  >
    <a-form :form="form">
      <a-row>
        <a-col :md="12" :sm="24"
          ><a-form-item label="费率代码(自动生成)" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['feeCd']"></a-input>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24"
          ><a-form-item label="费率名称" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['feeName']" /> </a-form-item
        ></a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24"
          ><a-form-item label="费率描述" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['feeDesc']"></a-input>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label="费率使用场景" v-bind="formItemLayout">
            <a-select :disabled="true" v-decorator="['feeScene']">
              <a-select-option value="0">单日交易累计金额计费</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24"
          ><a-form-item label="注销原因" v-bind="formItemLayout">
            <a-input
              :disabled="true"
              row="3"
              v-decorator="['cancelReason']"
            ></a-input>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24"
          ><a-form-item label="审批意见" v-bind="formItemLayout">
            <a-input
              :disabled="true"
              row="3"
              v-decorator="['auditRefuseReason']"
            /> </a-form-item
        ></a-col>
      </a-row>
       <fee-table ref="feeTable"></fee-table>
    </a-form>
  </a-modal>
</template>
<script>
import FeeTable from "../feeTable/FeeTable";

const formItemLayout = {
  labelCol: { span: 10 },
  wrapperCol: { span: 14 },
};
export default {
  name: "FeeInfo",
  components: { FeeTable},
  props: {
    feeInfoVisiable: {
      default: false,
    },
  },
  data() {
    return {
      formItemLayout,
      form: this.$form.createForm(this),
      loading: false,
    };
  },
  methods: {

    onClose() {
      this.loading = false;
      this.$emit("close");
    },
    setFormValues({ ...list },[ ...feeInfos ],type) {
      let fields = [
        "feeCd",
        "feeName",
        "feeDesc",
        "feeScene",
        "cancelReason",
        "auditRefuseReason",
      ];
      Object.keys(list).forEach((key) => {
        if (fields.indexOf(key) !== -1) {
          this.form.getFieldDecorator(key);
          let obj = {};
          obj[key] = list[key];
          this.form.setFieldsValue(obj);
        }
      });
      this.$refs.feeTable.dataSource = feeInfos;
      this.$refs.feeTable.operatorType = type;
    },

    handleSubmit() {
    },
  },
  watch: {},
};
</script>
